from pydantic import BaseModel, Field
from typing import List, Optional

class BaseCustomers(BaseModel):
    qymc: Optional[str] = Field("")
    qysh: Optional[str] = Field("")
    zjqk: Optional[str] = Field("")
    kp24: Optional[str] = Field("")
    kp23: Optional[str] = Field("")
    name: Optional[str] = Field("")
    sfz: Optional[str] = Field("")
    phone: Optional[str] = Field("")
    address: Optional[str] = Field("")
    yh_no: Optional[str] = Field("")
    yh_khh: Optional[str] = Field("")
    yh_phone: Optional[str] = Field("")
    hyzk: Optional[str] = Field("")
    po_name: Optional[str] = Field("")
    po_phone: Optional[str] = Field("")
    po_sfz: Optional[str] = Field("")
    contact1: Optional[str] = Field("")
    contact2: Optional[str] = Field("")
    sfz_z: Optional[str] = Field("")
    sfz_f: Optional[str] = Field("")
    yyzz: Optional[str] = Field("")
    price: Optional[int] = Field(0)
    add_uid: Optional[int] = Field(0)
    status: Optional[int] = Field(0)

class CustomersCreate(BaseCustomers):
    ...

class CustomersUpdate(BaseCustomers):
    id: int
    def update_dict(self):
        return self.model_dump(exclude_unset=True, exclude={"id"})

class BaseCustomersFollow(BaseModel):
    qymc: Optional[str] = Field("")
    qysh: Optional[str] = Field("")
    name: Optional[str] = Field("")
    yh_no: Optional[str] = Field("")
    yh_khh: Optional[str] = Field("")
    yh_phone: Optional[str] = Field("")

class CustomersFollowCreate(BaseCustomersFollow):
    ...

class CustomersFollowUpdate(BaseCustomersFollow):
    id: int
    def update_dict(self):
        return self.model_dump(exclude_unset=True, exclude={"id"})